#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>    

#include <stdlib.h>   

#include <string.h>

#include <assert.h>

char* my_strncpy(char* dest, const char* src, int num)

{

	char* temp = dest;

	assert(dest);

	while (num)

	{

		*dest++ = *src++;

		num--;

	}

	return dest;

}



int main()

{

	char arr1[] = "abcdef";

	char arr2[20] = { 0 };

	my_strncpy(arr2, arr1, 3);

	printf("%s", arr2);

	return 0;

}